//
//  AXFMineSubViewController.m
//  aixinfeng005
//
//  Created by 陈天佑 on 16/10/11.
//  Copyright © 2016年 BBSWaitting. All rights reserved.
//

#import "AXFMineSubViewController.h"
#import "AXFMineTopViewController.h"
#import "AXFMineBottomViewController.h"

@interface AXFMineSubViewController ()

@end

@implementation AXFMineSubViewController

- (void)viewDidLoad
{
    //获取当前屏幕高度
    CGFloat screenH = [UIScreen mainScreen].bounds.size.height;
    //获取当前品目宽度
    CGFloat screenW = [UIScreen mainScreen].bounds.size.width;
    [super viewDidLoad];
    //xib创建视图控制器
    UIViewController * topVC = [[AXFMineTopViewController alloc] initWithNibName:@"AXFMineTopViewController" bundle:nil];
    [self addChildViewController:topVC];
    [self.view addSubview:topVC.view];
    [topVC didMoveToParentViewController:self];
    [self.view.subviews.firstObject mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.equalTo(self.view);
        make.height.equalTo(@(screenH * 0.3));
        make.width.equalTo(@(screenW));
    }];
    //storyboard创建控制器
    UIViewController * bottomVC = [[UIStoryboard storyboardWithName:@"AXFMineBottom" bundle:nil] instantiateInitialViewController];
    [self addChildViewController:bottomVC];
    [self.view addSubview:bottomVC.view];
    [bottomVC didMoveToParentViewController:topVC];
    [self.view.subviews.lastObject mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.left.equalTo(self.view);
        make.height.equalTo(@(screenH * 0.7));
        make.width.equalTo(@(screenW));
    }];
    
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
}


@end
